#pragma once
#include <map>
#include <memory>
#include <sys/epoll.h>
#include <unistd.h>
#include "Conectfd.h"
class Connectfd;
class EpollLoop
{
public:
    EpollLoop() : epfd(epoll_create(1)) {}
    ~EpollLoop();

    void addConnect(int fd, uint32_t events);
    void addConnectClient(int fd, uint32_t events);
    void removeConn(int fd);
    void modefiyEvent(int fd, uint32_t events);
    void run();

public:
    int epfd;
    std::map<int, std::unique_ptr<Connectfd>> m_Connects;
    static const int MAX_EVENT = 1024;
};